<%--
  Created by IntelliJ IDEA.
  User: Li Chuanwei
  Date: 2023-07-16
  Time: 13:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>并夕夕官网</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all">
    <script src="${pageContext.request.contextPath}/static/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/fontawesome/css/all.css" media="all">
    <style>
        body {
            background: rgb(234, 232, 235);
        }

        .mainContainer {
            margin-top: 5vh;
            margin-left: 11vw;
            width: 78vw;
            background: white;
            border: 1px solid #f2f2f2;
            border-radius: 10px;
            padding: 10px;
        }

        .centerContainer {
            margin-top: 1%;
            width: 100%;
        }

        .layui-card {
            border: 1px solid #f2f2f2;
            border-radius: 5px;
        }

        .icon {
            margin-right: 10px;
            color: #1aa094;
        }

        .layuimini-qiuck-module {
            text-align: center;
            margin-top: 10px
        }

        .layuimini-qiuck-module a i {
            display: inline-block;
            width: 100%;
            height: 60px;
            line-height: 60px;
            text-align: center;
            border-radius: 2px;
            font-size: 30px;
            background-color: #F8F8F8;
            color: #333;
            transition: all .3s;
            -webkit-transition: all .3s;
        }

        .layuimini-qiuck-module a cite {
            position: relative;
            top: 2px;
            display: block;
            color: #666;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            font-size: 14px;
        }

        .main_btn > p {
            height: 40px;
        }

        .goodsCard {
            width: 100%;
            height: 160px;
            border-radius: 5px;
            background: rgb(247, 249, 250);
            position: relative;
        }

        .goodsCard img {
            padding: 5px;
            border-radius: 10px;
            max-width: 10vw;
            max-height: 10vw;
            min-width: 10vw;
            min-height: 10vw;
        }

        .goodsContainer {
            padding: 10px;
        }

        .goodsText {

        }

        .goodsInfo {
            margin-top: 10px;
            font-size: 1.1em;
        }

        .goodsPrice {
            color: red;
            font-size: 2em;
            margin-top: 50%;
        }
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <!-- 头部 -->
        <div class="layui-row">
            <jsp:include page="../common/_top.jsp"></jsp:include>
        </div>

        <div class="mainContainer">
            <div class="layui-row layui-col-space15 centerContainer">
                <div class="layui-col-md3">
                    <!-- 左边栏 -->
                    <div class="">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-warning icon"></i>分类</div>
                            <div class="layui-card-body" style="text-align: center;font-size: 1.4em">
                                <p>女装/内衣/奢品</p>
                                <p>女鞋/男鞋/箱包</p>
                                <p>美妆/饰品/洗护</p>
                                <p>男装/运动/百货</p>
                                <p>手机/数码/企业</p>
                                <p>家装/电器/车品</p>
                                <p>食品/生鲜/母婴</p>
                                <p>医药/保健/进口</p>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-col-md6">
                    <div class="layui-row layui-col-space15">
                        <!-- 轮播图 -->
                        <div class="layui-carousel" style="border-radius: 5px;">
                            <div carousel-item="">
                                <div><img src="${IMG_SERVER}/carousel/c01.jpg" width="100%"></div>
                                <div><img src="${IMG_SERVER}/carousel/c02.jpg" width="100%"></div>
                                <div><img src="${IMG_SERVER}/carousel/c03.jpg" width="100%"></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-col-md3">
                    <!-- 右边栏 -->
                    <c:if test="${not empty sessionScope.user}">
                        <div class="layui-row">
                            <div class="user-info layui-card">
                                <div class="layui-card-header">个人信息</div>
                                <div class="layui-card-body">
                                    <p>用户名：${sessionScope.user.getNickname()}</p>
                                    <p>邮箱：${sessionScope.user.getEmail()}</p>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <a href="${pageContext.request.contextPath}/user/cartItem/userCart">
                                                <p style="text-align: center">6</p>
                                                <p style="text-align: center">购物车</p>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <a href="${pageContext.request.contextPath}/user_orderDetails?userIds=${sessionScope.user.getId()}">
                                                <p style="text-align: center">6</p>
                                                <p style="text-align: center">待发货</p>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <a href="${pageContext.request.contextPath}/user_orderDetails?userIds=${sessionScope.user.getId()}">
                                                <p style="text-align: center">6</p>
                                                <p style="text-align: center">待收货</p>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <a href="${pageContext.request.contextPath}/user_orderDetails?userIds=${sessionScope.user.getId()}">
                                                <p style="text-align: center">6</p>
                                                <p style="text-align: center">待评价</p>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="quick-actions layui-card">
                                <div class="layui-card-header">快捷操作</div>
                                <div class="layui-card-body">
                                    <div class="layui-row layui-col-space4">
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="${pageContext.request.contextPath}/mto_userManager;"
                                               data-title="个人中心"
                                               data-icon="fa fa-users">
                                                <i class="fa fa-users"></i>
                                                <cite style="font-size: 0.8em">个人中心</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="${pageContext.request.contextPath}/" data-title="订单详情"
                                               data-icon="fa fa-clipboard-check">
                                                <i class="fa fa-clipboard-check"></i>
                                                <cite style="font-size: 0.8em">订单详情</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="${pageContext.request.contextPath}/" data-title="个人中心"
                                               data-icon="fa fa-shipping-fast">
                                                <i class="fa fa-shipping-fast"></i>
                                                <cite style="font-size: 0.8em">地址管理</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="${pageContext.request.contextPath}/" data-title="个人中心"
                                               data-icon="fa fa-users">
                                                <i class="fa fa-users"></i>
                                                <cite style="font-size: 0.8em">订单详情</cite>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </c:if>
                    <c:if test="${empty sessionScope.user}">
                        <div class="layui-row">
                            <div class="user-info layui-card">
                                <div class="layui-card-header">您好，欢迎进入并夕夕平台！</div>
                                <div class="layui-card-body">
                                    您尚未登录， 请<a href="${pageContext.request.contextPath}/uto_login"
                                                     style="color: red;font-size: 1em">点击此处</a> 进行登录！
                                </div>
                            </div>
                        </div>
                    </c:if>
                </div>
            </div>

            <div class="layui-row layui-col-space15">
                <p style="font-size: 1.5em;margin-left: 10px">猜你喜欢
                    <img style="max-height: 20px" src="${pageContext.request.contextPath}/static/img/gexingtuijian.jpg">
                </p>
            </div>

            <div class="goodsContainer">
                <div class="layui-row layui-col-space30">
                    <c:forEach items="${goodsList}" var="goods">
                        <div class="layui-col-xs4">
                            <a href="${pageContext.request.contextPath}/goodsDetails?id=${goods.id}">
                                <div class="goodsCard">
                                    <div class="layui-row">
                                        <div class="layui-col-xs6">
                                            <img src="${IMG_SERVER}/goods/${goods.pic}">
                                        </div>
                                        <div class="layui-col-xs6 goodsText">
                                            <p class="goodsInfo">${goods.name}</p>
                                            <p class="goodsPrice">¥${goods.price1}</p>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </c:forEach>
                </div>
            </div>

        </div>
    </div>
</div>

</div>

<script>
    // 使用轮播图组件
    layui.use('carousel', function () {
        var carousel = layui.carousel;
        // 轮播图配置
        carousel.render({
            elem: '.layui-carousel',
            width: '98%',
            height: '300px',
            arrow: 'always',
            anim: 'fade'
        });
    });
</script>
</body>
</html>
